package com.wang.kmp.shared.server.exts

inline fun <reified T : Throwable> Throwable?.getCauseException(): T? {
    var current: Throwable? = this
    while (current != null) {
        if (current is T) return current

        current = current.cause
    }
    return null
}